# b'{"errcode":400403,"errmsg":"miss param : markdown-\\u003Etext"}'
from dingtalkchatbot.chatbot import DingtalkChatbot


def send(message, at_mobiles=[18670905392, 18573778821]):
    # 引用 settings里面配置的钉钉群消息通知的WebHook地址:
    webhook = 'https://oapi.dingtalk.com/robot/send?access_token=3a60e3839feb5a53c0a54d32d2e5861fc7f41903a6412e2b0080cb3751dd63e9'
    # 初始化机器人小丁, # 方式一：通常初始化方式
    # xiaoding = DingtalkChatbot(webhook)
    secret = 'SEC113d58d62f72b5958ddaa25b8c76e3c181b316720afaf53fc94f1b906b95faac'
    # 方式二：勾选“加签”选项时使用（v1.5以上新功能）
    xiaoding = DingtalkChatbot(webhook, secret=secret)

    # Text消息@所有人
    msg = xiaoding.send_text(msg=('面试通知: %s' % message), at_mobiles=at_mobiles )
    print(msg)


send('候选人 阿民 进入面试环节,亲爱的面试官,请做好准备:root')